<template>
	<div>
		<component :is="table.getVNode()"></component>
	</div>

	<button @click="get">get</button>
</template>

<script setup lang="ts">
// @ts-nocheck
import { BasicTaleBox } from "@pkg";

const get = () => {
	console.log(table.getTableSelectionData(), " table.getTableSelectionData()");
};

const table = new BasicTaleBox({});

table.setTableSelection(true);
table.setTableSource([
	{
		name: "https://ecmb.bdimg.com/tam-ogel/1815134652_-1760084283_1200_1200.png",
		name1: "李四1",
		name2: 1689837422609,
		name3: "Y",
		name4: 2500,
	},
	{
		name: "https://ecmb.bdimg.com/tam-ogel/1815134652_-1760084283_1200_1200.png",
		name1: "李四2",
		name2: 1689837422609,
		name3: "Y",
		name4: 2500,
	},
	{
		name: "https://ecmb.bdimg.com/tam-ogel/1815134652_-1760084283_1200_1200.png",
		name1: "李四3",
		name2: 1689837422609,
		name3: "Y",
		name4: 2500,
	},
]);

table.addTableCol([
	{
		key: "name1",
		name: "姓名",
		modify: "text",
	},
	{
		key: "name",
		name: "图片",
		component: "TableImage",
	},
	{
		key: "name2",
		name: "时间",
		format: "dateTime",
	},
	{
		key: "name4",
		name: "金额",
		format: "money",
	},
	{
		key: "name3",
		component: "TableSwitch",
		name: "冻结",
	},
]);

onMounted(() => {
	table.setTableOption({});
	console.log("重写了配置");
});
</script>

<style lang="scss" scoped></style>
